<template>
	<div class="mine">
		<div></div>
	</div>
</template>

<script setup>
	import { ref, reactive,computed, getCurrentInstance,watch,onMounted,onUpdated} from 'vue'
	import { useStore } from 'vuex'
  import { getUser } from '../../api/otherApi.js'
  import axios from 'axios'
	const { proxy } = getCurrentInstance()
	const _this = proxy;

  const key = ref('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')
  let data = reactive({
            prompt: '你好',
            temperature: 0.8,
            model: "text-davinci-003",
            max_tokens: '2048',
          })
	
	axios.post('https://api.openai.com/v1/completions',
  data,
  {
    headers: {
              'Content-Type': 'application/json',
              'Authorization': `Bearer ${key.value}`,
            }
  }
  ).then(res=>{
    console.log(res)
  })
	
	
	onMounted(async ()=>{
    let data = await getUser() 
    console.log(data)
	})
</script>

<style scoped lang="scss">
	
</style>
